package common;

import server.MyProtocol;

import java.io.Serializable;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Igor Demidov
 * Date: 25.02.13
 * Time: 13:37
 */
public class DataTransferObject implements Serializable {
    private MyProtocol.Command cmd;
    private Object data;

    public DataTransferObject(MyProtocol.Command cmd, LoginPassword loginPassword) {
        this.cmd = cmd;
        data = loginPassword;
    }

    public DataTransferObject(MyProtocol.Command cmd, User user) {
        this.cmd = cmd;
        data = user;
    }

    public DataTransferObject(MyProtocol.Command cmd, String userLogin) {
        this.cmd = cmd;
        data = userLogin;
    }

    public DataTransferObject(MyProtocol.Command cmd, Email email) {
        this.cmd = cmd;
        data = email;
    }

    public DataTransferObject(MyProtocol.Command cmd, List<Email> emails) {
        this.cmd = cmd;
        data = emails;
    }

    public DataTransferObject(MyProtocol.Command cmd) {
        this.cmd = cmd;
    }

    public MyProtocol.Command getCmd() {
        return cmd;
    }

    public Object getData() {
        return data;
    }
}
